﻿using System.Collections.Generic;
using System.Xml.Serialization;

namespace IDT.Downloader
{
    public class WebInfo
    {
        public string Name { get; set; }

        public string HomeUrl { get; set; }

        public string StartUrl { get; set; }

        public string NavgationLinkPath { get; set; }

        public string AlbumUrlXpath { get; set; }

        public string LastAlbumXpath { get; set; }

        public string TotalImageCountXpath { get; set; }

        public string ImageXpath { get; set; }

        public string ImageInsertedTimeXpath { get; set; }

        //[XmlElement("IgnoredUrls", ElementName = "Url")]
        [XmlArray(ElementName = "IgnoredUrls")]
        [XmlArrayItem(ElementName = "Url")]
        public List<string> IgnoredUrls { get; set; }

        public string Encoding { get; set; } = "UTF-8";

        public bool IsSkipped { get; set; }

        public WebInfo()
        {
        }

        public WebInfo(
            string name,
            string homeUrl,
            string startUrl,
            string navgationLinkPath,
            string albumUrlXpath,
            string lastAlbumXpath,
            string totalImageCountXpath,
            string imageXpath,
            string imageInsertedTimeXpath,
            List<string> ignoredUrls,
            string encoding,
            bool isSkipped)
        {
            Name = name;
            HomeUrl = homeUrl;
            StartUrl = startUrl;
            NavgationLinkPath = navgationLinkPath;
            AlbumUrlXpath = albumUrlXpath;
            LastAlbumXpath = lastAlbumXpath;
            TotalImageCountXpath = totalImageCountXpath;
            ImageXpath = imageXpath;
            ImageInsertedTimeXpath = imageInsertedTimeXpath;
            IgnoredUrls = ignoredUrls;
            Encoding = encoding;
            IsSkipped = isSkipped;
        }
    }
}